<link href="/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
<link href="/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/assets/global/css/components.css" id="style_components" rel="stylesheet" type="text/css"/>


<div class="page-content">
    <div class="portlet-body">
        <div class="row-fluid">
            <div class="span12">
                <!--BEGIN TABS-->
                <div class="tabbable tabbable-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1_1" data-toggle="tab">入库阶段</a></li>
                        <li ><a href="#tab_1_2" data-toggle="tab">立项阶段</a></li>
                        <li ><a href="#tab_1_3" data-toggle="tab">决策阶段</a></li>
                        <li ><a href="#tab_1_4" data-toggle="tab">投资阶段</a></li>
                        <li ><a href="#tab_1_5" data-toggle="tab">投后阶段</a></li>
                        <li ><a href="#tab_1_6" data-toggle="tab">退出阶段</a></li>
                        <#if project.proState?? && project.proState == -1>
                            <li ><a href="#tab_1_-1" data-toggle="tab">异常阶段</a></li>
                        </#if>
                        <#if project.proState?? && project.proState == 7>
                            <li ><a href="#tab_1_7" data-toggle="tab">否决阶段</a></li>
                        </#if>

                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_1_1">
                            <p>公司需求：${project.proCompanyRequire!}</p>
                            <p>公司情况：${project.proCompanyCondition!}</p>
                            <div class="btn-group">
                                <br />
                                <button type="button" class="btn btn-success" onclick="rukuEdit()" ><span class="glyphicon glyphicon-list-alt"></span> 编辑</button>
                            </div>
                            <br/>
                            <br/>
                            <#if RKFiles ??>
                                <p> 上传文件：</p>
                                <table class="table table-hover table-bordered">
                                <tbody>
                                <#list RKFiles as file>
                                    <tr>
                                    <td style="width: 70%">${file.fileName!}</td>
                                    <td>
                                    <div class="btn-group">
                                <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                    </div>
                                    </td>
                                    </tr>
                                </#list>
                                </tbody>
                                </table>
                            </#if>
                        </div>
                        <div class="tab-pane" id="tab_1_2">
                            <p>项目负责人：${project.proManager!'还未填写'}</p>
                            <p>立项时间：${project.proApprovalTime!'还未填写'}</p>
                            <div class="btn-group">
                                <br />
                                <button type="button" class="btn btn-success" onclick="lixiangEdit()" ><span class="glyphicon glyphicon-list-alt"></span> 编辑</button>
                            </div>
                            <br/>
                            <br/>
                            <#if LXFiles ??>
                                <p> 上传文件：</p>
                                <table class="table table-hover table-bordered">
                                <tbody>
                                <#list LXFiles as file>
                                    <tr>
                                    <td style="width: 70%">${file.fileName!}</td>
                                    <td>
                                    <div class="btn-group">
                                <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                    </div>
                                    </td>
                                    </tr>
                                </#list>
                                </tbody>
                                </table>
                            </#if>
                        </div>
                        <div class="tab-pane" id="tab_1_3">
                            <p>投资对象：${project.proInvestment!'还未填写'}</p>
                            <p>项目投资金额：${project.proInvestmentMoney!'还未填写'}</p>
                            <p>项目投资方式：${project.proJueCeInvestType!'还未填写'}</p>
                            <p>项目投资主体：${project.proJueCeInvestCorpus!'还未填写'}</p>
                            <p>项目尽调获取方式：${project.proJueCeReport!'还未填写'}</p>
                            <#if project.proJueCeReport?? && project.proJueCeReport == "采信第三方">
                                <p>采信原因：${project.proBelieveReason!'还未填写'}</p>
                                <p>第三方机构名称：${project.proThirdOrgName!'还未填写'}</p>
                                <p>尽调报告费用：${project.proReportMoney!'还未填写'}</p>
                            <#elseif project.proJueCeReport?? && project.proJueCeReport == "自己组织尽调">
                                <p>法律尽调机构：${project.proLawOrg!'还未填写'}</p>
                                <p>法律尽调机构费用：${project.proLawMoney!'还未填写'}</p>
                                <p>财务尽调机构：${project.proFinanceOrg!'还未填写'}</p>
                                <p>财务尽调机构费用：${project.proFinanceMoney!'还未填写'}</p>
                                <p>资产评估机构：${project.proAssetsOrg!'还未填写'}</p>
                                <p>资产评估费用：${project.proAssetsMoney!'还未填写'}</p>
                                <p>其他重要事项：${project.proImportantNotes!'还未填写'}</p>
                            </#if>
                            <p>投决会会议纪要：${project.proJcVotintMeet!'还未填写'}</p>
                            <p>董事会会议纪要：${project.proJcDongShiHui!'还未填写'}</p>
                            <p>集团董事会会议纪要：${project.proJcJiTuan!'还未填写'}</p>

                            <div class="btn-group">
                                <br />
                                <button type="button" class="btn btn-success" onclick="jueceEdit()" ><span class="glyphicon glyphicon-list-alt"></span> 编辑</button>
                            </div>
                        <br/>
                        <br/>

                            <#if JCFiles ??>
                                <p> 上传文件：</p>
                                <table class="table table-hover table-bordered">
                                <tbody>
                                <#list JCFiles as file>
                                    <tr>
                                    <td style="width: 70%">${file.fileName!}</td>
                                    <td>
                                    <div class="btn-group">
                                <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                    </div>
                                    </td>
                                    </tr>
                                </#list>
                                </tbody>
                                </table>
                            </#if>
                        </div>
                        <div class="tab-pane" id="tab_1_4">
                            <p>项目实际投资时间：${project.proRealInvestmentTime!'还未填写'}</p>
                            <p>项目付款时间：${project.proPaymentTime!'还未填写'}</p>
                            <p>项目付款金额：${project.proPaymentMoney!'还未填写'}</p>
                            <p>项目投资股权比例：${project.proRealProportion!'还未填写'}</p>
                            <p>付款方式：<#if project.proPaymentMethod?? && project.proPaymentMethod == '0'>
                                一次性付
                            <#elseif project.proPaymentMethod?? && project.proPaymentMethod == '1'>
                                分期付
                                </#if></p>
                            <#if project.proPaymentMethod?? && project.proPaymentMethod == '1'>
                                <#if finance??>
                                    <table class="table table-hover table-bordered">
                                    <tr>
                                        <td>第几期</td>
                                        <td>付款金额</td>
                                        <td>付款比例</td>
                                    </tr>
                                    <#list finance as list>
                                        <tr>
                                        <td>${list.proPhase!}</td>
                                        <td>${list.proPaymentAmount!}</td>
                                        <td>${list.proPaymentRatio!}</td>
                                        </tr>
                                    </#list>
                                    </table>
                                </#if>
                            </#if>
                            <p>项目合同主要条款：${project.proContent!'还未填写'}</p>
                            <div class="btn-group">
                                <br />
                                <button type="button" class="btn btn-success" onclick="touziEdit()" ><span class="glyphicon glyphicon-list-alt"></span> 编辑</button>
                            </div>
                        <br/>
                        <br/>
                            <#if TZFiles ??>
                                <p> 上传文件：</p>
                                <table class="table table-hover table-bordered">
                                <tbody>
                                <#list TZFiles as file>
                                    <tr>
                                    <td style="width: 70%">${file.fileName!}</td>
                                    <td>
                                    <div class="btn-group">
                                <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                    </div>
                                    </td>
                                    </tr>
                                </#list>
                                </tbody>
                                </table>
                            </#if>
                        </div>
                        <div class="tab-pane" id="tab_1_5">
                            <p>项目实际投资时间</p>

                            <#if THFiles ??>
                                <p> 上传文件：</p>
                                <table class="table table-hover table-bordered">
                                    <tbody>
                                        <#list THFiles as file>
                                        <tr>
                                            <td style="width: 70%">${file.fileName!}</td>
                                            <td>
                                                <div class="btn-group">
                                                    <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                                    <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                                </div>
                                            </td>
                                        </tr>
                                        </#list>
                                    </tbody>
                                </table>
                            </#if>

                        </div>
                        <div class="tab-pane" id="tab_1_6">
                            <p>项目退出协议：${project.proOutWay!'还未填写'}</p>
                            <p>项目金额：${project.proOutMoney!'还未填写'}</p>
                            <p>项目总结：${project.proOutContent!'还未填写'}</p>
                            <#if TCFiles ??>
                                <p> 上传文件：</p>
                                <table class="table table-hover table-bordered">
                                    <tbody>
                                        <#list TCFiles as file>
                                        <tr>
                                            <td style="width: 70%">${file.fileName!}</td>
                                            <td>
                                                <div class="btn-group">
                                                    <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                                    <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                                </div>
                                            </td>
                                        </tr>
                                        </#list>
                                    </tbody>
                                </table>
                            </#if>
                        </div>

                        <#if project.proState?? && project.proState == -1>
                            <div class="tab-pane" id="tab_1_-1">
                        <#--判断对象不为null，且列表不为空-->
                            <p>项目名称：${project.proName!}</p>
                            <p>异常原因：${errorprojectEntity.errorReason!}</p>
                            <p>异常所处阶段：${errorprojectEntity.state!}</p>
                            <#if errorDetailAndFileList?? && (errorDetailAndFileList?size>0)>
                                <p><span style="text-align: center;font-weight: normal;font-size: 24px;display: block">共${errorDetailAndFileList?size}条异常详情</span></p>
                                <#list errorDetailAndFileList as list>
                                    <p><span style="text-align: center;font-weight: normal;font-size: 20px;display: block">当前第${list_index+1}条信息</span></p>
                                    <p>异常信息录入时间：${list.errorTime!'还未填写'}</p>
                                    <p>异常原因：${list.errorContent!'还未填写'}</p>
                                    <#if list.fileEntityList ??>
                                        <p> 上传文件：</p>
                                        <table class="table table-hover table-bordered">
                                        <tbody>
                                        <#list list.fileEntityList as file>
                                            <tr>
                                            <td style="width: 70%">${file.fileName!}</td>
                                            <td>
                                            <div class="btn-group">
                                        <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                        <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                            </div>
                                            </td>
                                            </tr>
                                        </#list>
                                        </tbody>
                                        </table>
                                    </#if>
                                </#list>

                            <#else >
                                <p><span style="font-weight: normal;font-size: 24px;display: block">尚未录入异常信息！</span></p>
                            </#if>
                            </div>
                        </#if>

                        <#if project.proState?? && project.proState == 7>
                            <div class="tab-pane" id="tab_1_7">
                        <#--判断对象不为null，且列表不为空-->
                            <p>项目名称：${project.proName!}</p>
                            <p>否决原因：${errorprojectEntity.errorReason!}</p>
                            <p>否决所处阶段：${errorprojectEntity.state!}</p>
                            <#if errorDetailAndFileList?? && (errorDetailAndFileList?size>0)>
                                <p><span style="text-align: center;font-weight: normal;font-size: 24px;display: block">共${errorDetailAndFileList?size}条否决详情</span></p>
                                <#list errorDetailAndFileList as list>
                                    <p><span style="text-align: center;font-weight: normal;font-size: 20px;display: block">当前第${list_index+1}条信息</span></p>
                                    <p>否决信息录入时间：${list.errorTime!'还未填写'}</p>
                                    <p>否决原因：${list.errorContent!'还未填写'}</p>
                                    <#if list.fileEntityList ??>
                                        <p> 上传文件：</p>
                                        <table class="table table-hover table-bordered">
                                        <tbody>
                                        <#list list.fileEntityList as file>
                                            <tr>
                                            <td style="width: 70%">${file.fileName!}</td>
                                            <td>
                                            <div class="btn-group">
                                        <button type="button" class="btn btn-danger"  onclick="del(${file.id})" ><span class="glyphicon glyphicon-trash"></span> 删除</button>
                                        <button type="button" class="btn btn-primary" onclick="detail(${file.id})" ><span class="glyphicon glyphicon-list-alt"></span> 查看</button>
                                            </div>
                                            </td>
                                            </tr>
                                        </#list>
                                        </tbody>
                                        </table>
                                    </#if>
                                </#list>

                            <#else >
                                <p><span style="font-weight: normal;font-size: 24px;display: block">尚未录入否决信息！</span></p>

                            </#if>
                            </div>
                        </#if>
                    </div>

                </div>
                <!--END TABS-->
            </div>
        </div>
    </div>
</div>


<script src="/assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="/lib/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
<script src="/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>

<script>
    function rukuEdit(){
        var id = ${project.id!};
        var url = '/project-ruku-edit/'+id+'/1';
        var index = parent.layer.open({
            title:'项目修改',
            type: 2,
            offset:'20px',
            area: ['1000px', '500px'],
            fixed: true, //不固定
            maxmin: true,
            content: url
        });
    }

    function lixiangEdit(){
        var id = ${project.id!};
        var url = '/project-lixiang-edit/'+id+'/1';
        var index = parent.layer.open({
            title:'项目立项',
            type: 2,
            offset:'20px',
            area: ['1000px', '500px'],
            fixed: true, //不固定
            maxmin: true,
            content: url
        });
    }

    function jueceEdit(){
        var id = ${project.id!};
        var url = '/project-juece-edit/'+id+'/1';
        var index = layer.open({
            title:'项目决策',
            type: 2,
            offset:'20px',
            fixed: true, //不固定
            maxmin: true,
            area: ['1000px', '500px'],
            content: url
        });
    }
    function touziEdit(){
        var id = ${project.id!};
        var url = '/project-touzi-edit/'+id+'/1';
        var index = parent.layer.open({
            title:'项目投资',
            type: 2,
            offset:'20px',
            area: ['1000px', '500px'],
            fixed: true, //不固定
            maxmin: true,
            content: url
        });
    }
</script>

<script type="text/javascript">
    function del(value){
        $.ajax({
            type :'post',
            url : '/file-ins-upd-del/'+value,
            data : {deleteFlag:'Y'},
            async :false,
            success :function(){
                var index = parent.layer.getFrameIndex(window.name);
                parent.$('#project_table').datagrid('reload');
                parent.layer.close(index);
            }
        });
    }
    function detail(value){
        $.ajax({
            type :'post',
            url : '/file-location/'+value,
            async :false,
            success :function(data){
                console.log(data)
                var url = "http://"+window.location.host+data;
                window.open(url);
            }
        });

    }
</script>


<script>
    jQuery(document).ready(function() {
        Metronic.init(); // init metronic core components
        Layout.init(); // init current layout
    });
</script>
